package com.sgcc.system.api;

import com.sgcc.common.core.domain.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import com.sgcc.common.core.constant.ServiceNameConstants;
import com.sgcc.common.core.web.domain.AjaxResult;
import com.sgcc.system.api.domain.SysDept;
import com.sgcc.system.api.factory.RemoteDeptFallbackFactory;

import java.util.List;

/**
 * 用户服务
 * 
 * @author sgcc
 */
@FeignClient(contextId = "remoteDeptService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteDeptFallbackFactory.class)
public interface RemoteDeptService
{
	@GetMapping(value = "/dept/getInfoIsc")
    public AjaxResult getInfoIsc(@RequestParam("deptId") String deptId);
	
	@PostMapping("/dept/addIsc")
    public AjaxResult addIsc(@Validated @RequestBody SysDept dept);
	
	@PutMapping("/dept/editIsc")
    public AjaxResult editIsc(@Validated @RequestBody SysDept dept);
	
	@GetMapping("/dept/getAll")
    public AjaxResult getAll();

	@GetMapping("/dept/getUnit")
    public R getUnit(@RequestParam("deptId") String deptId);

	@GetMapping("/dept/getSubordinateUnit")
    public R getSubordinateUnit(@RequestParam("deptId") String deptId);

    @GetMapping("/dept/info/{deptId}")
    public R<SysDept> getDeptById(@PathVariable("deptId") String deptId);

    @GetMapping("/dept/getCityAndQuXianBySheng")
    public R getCityAndQuXianBySheng(@RequestParam("deptId") String deptId);

    @GetMapping("/dept/getAllCityAndDistrictInfo")
    public R getAllCityAndDistrictInfo();
}
